Attribute VB_Name = "ModImagen"
Option Explicit

Public Sub Cut_Imagen(File As String, index As Long, X As Long, Y As Long, Width As Long, Height As Long)

             DoEvents
            
            FrmMain.PicGrh.Cls
           With FrmMain.PicGrh
                .ScaleMode = vbPixels
                .AutoRedraw = True
            End With
    
            FrmMain.PicGrh.PaintPicture FrmMain.PicTemp(File).picture, 0, 0, 32, 32, X, Y, Width, Height
            FrmMain.PicGrh.AutoRedraw = True
            
            Clipboard.Clear
            Clipboard.SetData FrmMain.PicGrh.Image, vbCFBitmap
        

        FrmMain.ImgTiles.ListImages.Add index, "grh" & Str(index), FrmMain.PicGrh.Image

End Sub


